/**@FILE:BaseAction.java
 * @AUTHOR:qingsheng.zheng
 * @DATE:2015-2-1 上午11:59:56*/
package com.xf.toy.web.common;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.xf.pub.tool.ResponseTool;
import com.xf.toy.dao.page.Pagination;

/*******************************************
 * @COMPANY:alibaba
 * @CLASS:BaseAction
 * @DESCRIPTION:
 * @AUTHOR:qingsheng.zheng
 * @VERSION:v1.0
 * @DATE:2015-2-1 上午11:59:56
 *******************************************/
public class BaseAction {
	
	private  Long userid;

	protected Logger logger = LoggerFactory.getLogger(this.getClass());
	
	protected Logger operLogger=LoggerFactory.getLogger("operLog");

	protected void response(HttpServletResponse resp, Object info) {
		ResponseTool.get().response(resp, info);
	}
	protected void response(HttpServletResponse resp, Object info,Pagination page) {
		ResponseTool.get().response(resp, info,page);
	}
	
	protected Long  getUserId(HttpServletRequest request)
	{
		HttpSession session=request.getSession();
		if(session==null) return null;
		else return (Long) session.getAttribute("userid");
	}

}
